package com.controller;

import com.service.INoticeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import living.com.result.ApiResult;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author 大忽悠
 * @create 2022/2/13 9:12
 */
@Api(tags = "通知请求处理")
@RestController
@RequiredArgsConstructor
public class NoticeController {
  private final INoticeService iNoticeService;

  @ApiOperation("获取当前登录用户未读通知")
  @GetMapping("/unread_notices")
  public ApiResult<Map<String,Object>> getUnreadNotices(@ApiParam("起始页")@RequestParam Integer startPage,
                                                        @ApiParam("一页多少条数据")@RequestParam Integer pageSize)
  {
    return ApiResult.success(iNoticeService.iNoticeService(startPage,pageSize));
  }
}
